// 反转字符串
var reverseString = function (s) {
  const mid = Math.ceil(s.length / 2);
  const endIndex = s.length - 1;
  for (let n = 0; n < mid; n++) {
    const left = s[n];
    const right = s[endIndex - n];
    s[n] = right;
    s[endIndex - n] = left;
  }
  return s;
};

const ans = reverseString(["a", "b", "c", "d", "e"]);
console.log("ans: ", ans);
